<?php
require_once dirname(__FILE__)."/../init.php";

$fullName = $_POST['selectedFriend'];
$uid = $_POST['uid'];
$mobileNumber = $_POST['mobileNumber'];
$owner = ServiceFactory::getUserService()->getByUid($_uid);

$contact = new Contact();
$contact->setFullName($fullName);
$contact->setOwnerId($owner->getId());
$contact->setUid($uid);
$contact->setMobileNumber($mobileNumber);

ServiceFactory::getContactService()->add($contact);

?>
<fb:redirect url="index.php?_page=contacts&operation=add&success=true" />
